package com.hgy.hhao.springboot_vue.service.impl;

import com.hgy.hhao.springboot_vue.mapper.UserMapper;
import com.hgy.hhao.springboot_vue.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hgy.hhao.springboot_vue.service.UserService;

import java.util.List;

/**
 * @author HhaoAn
 * @date 2025年03月02日 21:29
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    @Override
    public void saveUser(User user) {
        userMapper.saveUser(user);
    }

    @Override
    public List<User> getAll() {
        return userMapper.getAll();
    }

    @Override
    public List<User> getAllByGender(Integer gender) {
        return userMapper.getAllByGender(gender);
    }

    @Override
    public void deleteById(Integer id) {
        userMapper.deleteById(id);
    }
}
